import {reqSearchList} from "@/api"

const actions = {
      // 搜索获取商品列表的请求
      async reqsearchList({commit},params={}){
        const result = await reqSearchList(params)
        commit('REQSEARCHLIST',result.data)
      }
}
const mutations = {
  REQSEARCHLIST(state,getsearchList){
    state.searchList = getsearchList
  }
}
const state = {
  searchList:{}
}
const getters = {
  goodsList(state){
    return state.searchList.goodsList || []
  },
  attrsList(state){
    return state.searchList.attrsList || []
  },
  trademarkList(state){
    return state.searchList.trademarkList || []
  }
}
export default {
  namespaced:true,
  actions,
  mutations,
  state,
  getters
}